package com.glsc.ngateway.common.base.converter.platform;

import com.alibaba.excel.util.CollectionUtils;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it.networkassets.RateExceptionExclude;
import com.glsc.ngateway.common.base.domainmapper.RateExceptionExcludeMapper;
import com.glsc.ngateway.common.api.platform.dto.it.networkassets.RateExceptionExcludeDto;

import java.util.List;
import java.util.stream.Collectors;

public class RateExceptionExcludeConverter {
    public static RateExceptionExcludeDto do2Dto(RateExceptionExclude domain){
        return RateExceptionExcludeMapper.INSTANCE.domain2dto(domain);
    }

    public static List<RateExceptionExcludeDto> do2Dto(List<RateExceptionExclude> doList){
        return CollectionUtils.isEmpty(doList) ? java.util.Collections.EMPTY_LIST : doList.stream().map(RateExceptionExcludeConverter::do2Dto).collect(Collectors.toList());
    }

    public static RateExceptionExclude dto2Do(RateExceptionExcludeDto dto){
        return RateExceptionExcludeMapper.INSTANCE.dto2domain(dto);
    }

    public static List<RateExceptionExclude> dto2Do(List<RateExceptionExcludeDto> dtoList){
        return CollectionUtils.isEmpty(dtoList) ? java.util.Collections.EMPTY_LIST : dtoList.stream().map(RateExceptionExcludeConverter::dto2Do).collect(Collectors.toList());
    }
}
